home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 85 / CD Actual 85 Febrero 2004.iso / Experto / Apache / apache_2.0.48-win32-x86-no_ssl.msi / Data.Cab / F251751_apr_ldap.h < prev    next >
Encoding:
C/C++ Source or Header  |  2003-10-29  |  5.9 KB  |  196 lines

  1. /* ====================================================================
  2.  * The Apache Software License, Version 1.1
  3.  *
  4.  * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
  5.  * reserved.
  6.  *
  7.  * Redistribution and use in source and binary forms, with or without
  8.  * modification, are permitted provided that the following conditions
  9.  * are met:
  10.  *
  11.  * 1. Redistributions of source code must retain the above copyright
  12.  *    notice, this list of conditions and the following disclaimer.
  13.  *
  14.  * 2. Redistributions in binary form must reproduce the above copyright
  15.  *    notice, this list of conditions and the following disclaimer in
  16.  *    the documentation and/or other materials provided with the
  17.  *    distribution.
  18.  *
  19.  * 3. The end-user documentation included with the redistribution,
  20.  *    if any, must include the following acknowledgment:
  21.  *       "This product includes software developed by the
  22.  *        Apache Software Foundation (http://www.apache.org/)."
  23.  *    Alternately, this acknowledgment may appear in the software itself,
  24.  *    if and wherever such third-party acknowledgments normally appear.
  25.  *
  26.  * 4. The names "Apache" and "Apache Software Foundation" must
  27.  *    not be used to endorse or promote products derived from this
  28.  *    software without prior written permission. For written
  29.  *    permission, please contact apache@apache.org.
  30.  *
  31.  * 5. Products derived from this software may not be called "Apache",
  32.  *    nor may "Apache" appear in their name, without prior written
  33.  *    permission of the Apache Software Foundation.
  34.  *
  35.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  36.  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  37.  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  38.  * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  39.  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  40.  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  41.  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  42.  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  43.  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  44.  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  45.  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  46.  * SUCH DAMAGE.
  47.  * ====================================================================
  48.  *
  49.  * This software consists of voluntary contributions made by many
  50.  * individuals on behalf of the Apache Software Foundation.  For more
  51.  * information on the Apache Software Foundation, please see
  52.  * <http://www.apache.org/>.
  53.  */
  54.  
  55. #include "apr.h"
  56. #include "apu.h"
  57.  
  58. /*
  59.  * apr_ldap.h is generated from apr_ldap.h.in by configure -- do not edit apr_ldap.h
  60.  */
  61. /**
  62.  * @file apr_ldap.h
  63.  * @brief  APR-UTIL LDAP 
  64.  */
  65. #ifndef APU_LDAP_H
  66. #define APU_LDAP_H
  67.  
  68. /**
  69.  * @defgroup APR_Util_LDAP LDAP
  70.  * @ingroup APR_Util
  71.  * @{
  72.  */
  73.  
  74.  
  75. /*
  76.  * This switches LDAP support on or off.
  77.  */
  78.  
  79. /* this will be defined if LDAP support was compiled into apr-util */
  80. #define APR_HAS_LDAP          1
  81.  
  82. /* this whole thing disappears if LDAP is not enabled */
  83. #if !APR_HAS_LDAP
  84.  
  85. #define APR_HAS_NETSCAPE_LDAPSDK    0
  86. #define APR_HAS_NOVELL_LDAPSDK      0
  87. #define APR_HAS_OPENLDAP_LDAPSDK    0
  88. #define APR_HAS_MICROSOFT_LDAPSDK   0
  89. #define APR_HAS_OTHER_LDAPSDK       0
  90.  
  91. #define APR_HAS_LDAP_SSL            0
  92. #define APR_HAS_LDAP_URL_PARSE    0
  93.  
  94.  
  95. #else /* ldap support available */
  96.  
  97.  
  98.    /* There a several LDAPv3 SDKs available on various platforms
  99.     * define which LDAP SDK is used 
  100.    */
  101. #define APR_HAS_NETSCAPE_LDAPSDK    0
  102. #define APR_HAS_NOVELL_LDAPSDK      0
  103. #define APR_HAS_OPENLDAP_LDAPSDK    0
  104. #define APR_HAS_MICROSOFT_LDAPSDK   1
  105. #define APR_HAS_OTHER_LDAPSDK       0
  106.  
  107.    /* define if LDAP SSL support is available 
  108.    */
  109. #define APR_HAS_LDAP_SSL            1
  110.  
  111.    /* If no APR_HAS_xxx_LDAPSDK is defined error out
  112.     * Define if the SDK supports the ldap_url_parse function 
  113.    */
  114. #if APR_HAS_NETSCAPE_LDAPSDK 
  115.    #define APR_HAS_LDAP_URL_PARSE      1
  116. #elif APR_HAS_NOVELL_LDAPSDK 
  117.    #define APR_HAS_LDAP_URL_PARSE      1
  118. #elif APR_HAS_OPENLDAP_LDAPSDK
  119.    #define APR_HAS_LDAP_URL_PARSE      1
  120. #elif APR_HAS_MICROSOFT_LDAPSDK
  121.    #define APR_HAS_LDAP_URL_PARSE      0
  122. #elif APR_HAS_OTHER_LDAPSDK
  123.    #define APR_HAS_LDAP_URL_PARSE      0
  124. #else
  125.    #define APR_HAS_LDAP_URL_PARSE      0
  126.    #error "ERROR no LDAP SDK defined!"
  127. #endif
  128.  
  129. /* These are garbage, our public macros are always APR_HAS_ prefixed,
  130.  * and use 0/1 values, not defined/undef semantics.  
  131.  *
  132.  * Will be deprecated in APR 1.0
  133.  */
  134. #if APR_HAS_LDAP
  135. #define APU_HAS_LDAP
  136. #endif
  137.  
  138.  
  139. /* LDAP header files */
  140.  
  141. #if APR_HAS_NETSCAPE_LDAPSDK
  142. #include <ldap.h>
  143. #include <lber.h>
  144. #if APR_HAS_LDAP_SSL 
  145. #include <ldap_ssl.h>
  146. #endif
  147. #endif
  148.  
  149. #if APR_HAS_NOVELL_LDAPSDK
  150. #include <ldap.h>
  151. #include <lber.h>
  152. #if APR_HAS_LDAP_SSL 
  153. #include <ldap_ssl.h>
  154. #endif
  155. #endif
  156.  
  157. #if APR_HAS_OPENLDAP_LDAPSDK
  158. #include <ldap.h>
  159. #include <lber.h>
  160. #endif
  161.  
  162. /* Included in Windows 2000 and later, earlier 9x/NT 4.0 clients
  163.  * will need to obtain the Active Directory Client Extensions.
  164.  */
  165. #if APR_HAS_MICROSOFT_LDAPSDK
  166. #include <winldap.h>
  167. #define LDAPS_PORT LDAP_SSL_PORT
  168. #endif
  169.  
  170.  
  171. /* LDAPv2 SDKs don't use const parameters in their prototypes.  
  172.  * LDAPv3 SDKs do use const.  When compiling with LDAPv2 SDKs, const_cast 
  173.  * casts away the constness, but won't under LDAPv3 
  174.  */
  175. #if LDAP_VERSION_MAX <= 2
  176. #define const_cast(x) ((char *)(x))
  177. #else
  178. #define const_cast(x) (x)
  179. #endif
  180.    
  181.  
  182. #include "apr_ldap_url.h"
  183.  
  184. /* Define some errors that are mysteriously gone from OpenLDAP 2.x */
  185. #ifndef LDAP_URL_ERR_NOTLDAP
  186. #define LDAP_URL_ERR_NOTLDAP LDAP_URL_ERR_BADSCHEME
  187. #endif
  188.  
  189. #ifndef LDAP_URL_ERR_NODN
  190. #define LDAP_URL_ERR_NODN LDAP_URL_ERR_BADURL
  191. #endif
  192.  
  193. /** @} */
  194. #endif /* APR_HAS_LDAP */
  195. #endif /* APU_LDAP_H */
  196.